package com.bluesky.plum.uimodels.render.swing.components;

import javax.swing.Box;
import javax.swing.JCheckBox;

import com.bluesky.plum.richdomain.RichDomainField;

public class SCheckBox extends
		com.bluesky.plum.uimodels.standard.components.CheckBox {

	
	private JCheckBox checkBox;

	public SCheckBox(RichDomainField field) {
		super(field);

		// JLabel l = new JLabel(getCaption());
		checkBox = new JCheckBox(getCaption(), (Boolean) getField().value);

		
	}

	@Override
	public Object getNativeComponent() {

		return checkBox;
	}

	@Override
	public Boolean isChecked() {
		
		return checkBox.isSelected();
	}
	
	@Override
	public void setChecked(boolean checked) {
		super.setChecked(checked);
		
		checkBox.setSelected(checked);
	}
}
